<template>
  <div class="traffic-card">
    <div class="traffic-header">
      <!-- 移除svg-icon组件 -->
      <div class="custom-icon people-icon"></div> <!-- 添加自定义图标 -->
      <span class="traffic-count">当前在馆人数：{{ count }}</span>
    </div>
    <el-progress 
      :percentage="percentage" 
      :color="trafficColor"
      class="traffic-progress"
    />
  </div>
</template>

<script>
export default {
  props: {
    count: {
      type: Number,
      default: 0
    },
    percentage: {
      type: Number,
      default: 0
    }
  },
  computed: {
    trafficColor() {
      return this.percentage > 80 ? '#ff4757' : '#409EFF';
    }
  }
}
</script>

<style scoped>
.traffic-card {
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  padding: 20px;
  height: 100%;
}

.traffic-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

/* 自定义图标样式 */
.custom-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 10px;
  position: relative;
}

/* 人物图标样式 */
.people-icon {
  background: #E6F7FF;
}

.people-icon::before,
.people-icon::after {
  content: '';
  position: absolute;
  background: #409EFF;
}

.people-icon::before {
  width: 12px;
  height: 16px;
  border-radius: 6px 6px 0 0;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.people-icon::after {
  width: 18px;
  height: 8px;
  border-radius: 0 0 6px 6px;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.traffic-count {
  font-size: 1.1rem;
  color: #303133;
}

.traffic-progress {
  width: 100%;
}

@media (max-width: 768px) {
  .custom-icon {
    width: 28px;
    height: 28px;
    margin-right: 8px;
  }
 
  .people-icon::before {
    width: 10px;
    height: 14px;
    top: 5px;
  }
 
  .people-icon::after {
    width: 16px;
    height: 7px;
    bottom: 5px;
  }
 
  .traffic-count {
    font-size: 1rem;
  }
}
</style>